package cn.edu.sgu.www.mhxysy.dto.jingmai;

import cn.edu.sgu.www.mhxysy.consts.CustomMessages;
import cn.edu.sgu.www.mhxysy.consts.RegExps;
import cn.edu.sgu.www.mhxysy.dto.DataTransferObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Positive;

/**
 * @author 沐雨橙风ιε
 * @version 1.0
 */
@Data
@ApiModel
public class StarStoneDTO implements DataTransferObject {

    @ApiModelProperty(value = "ID")
    private String id;

    /**
     * 晶石品质
     */
    @Positive(message = "晶石品质" + CustomMessages.ILLEGAL)
    @NotNull(message = "晶石品质" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "晶石品质", required = true)
    private Integer quality;

    /**
     * 物品状态
     */
    @Positive(message = "物品状态" + CustomMessages.ILLEGAL)
    @NotNull(message = "物品状态" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "物品状态", required = true)
    private Integer state;

    /**
     * 冻结天数
     */
    @Range(min = -1, max = 60, message = "冻结天数" + CustomMessages.ILLEGAL)
    @NotNull(message = "冻结天数" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "冻结天数", required = true)
    private Integer days;

    /**
     * 角色ID
     */
    @Pattern(regexp = RegExps.ROLE_ID, message = "角色ID" + CustomMessages.ILLEGAL)
    @NotBlank(message = CustomMessages.ROLE_ID_NOT_NULL)
    @ApiModelProperty(value = "角色ID", required = true)
    private String roleId;

    /**
     * 星辰晶石类型ID
     */
    @Positive(message = "星辰晶石类型ID" + CustomMessages.ILLEGAL)
    @NotNull(message = "星辰晶石类型" + CustomMessages.NOT_NULL)
    @ApiModelProperty(value = "星辰晶石类型ID", required = true)
    private Integer categoryId;
}